{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on function figure in module matplotlib.pyplot:\n",
      "\n",
      "figure(num=None, figsize=None, dpi=None, facecolor=None, edgecolor=None, frameon=True, FigureClass=<class 'matplotlib.figure.Figure'>, clear=False, **kwargs)\n",
      "    Creates a new figure.\n",
      "    \n",
      "    Parameters\n",
      "    ----------\n",
      "    \n",
      "    num : integer or string, optional, default: none\n",
      "        If not provided, a new figure will be created, and the figure number\n",
      "        will be incremented. The figure objects holds this number in a `number`\n",
      "        attribute.\n",
      "        If num is provided, and a figure with this id already exists, make\n",
      "        it active, and returns a reference to it. If this figure does not\n",
      "        exists, create it and returns it.\n",
      "        If num is a string, the window title will be set to this figure's\n",
      "        `num`.\n",
      "    \n",
      "    figsize : tuple of integers, optional, default: None\n",
      "        width, height in inches. If not provided, defaults to rc\n",
      "        figure.figsize.\n",
      "    \n",
      "    dpi : integer, optional, default: None\n",
      "        resolution of the figure. If not provided, defaults to rc figure.dpi.\n",
      "    \n",
      "    facecolor :\n",
      "        the background color. If not provided, defaults to rc figure.facecolor.\n",
      "    \n",
      "    edgecolor :\n",
      "        the border color. If not provided, defaults to rc figure.edgecolor.\n",
      "    \n",
      "    frameon : bool, optional, default: True\n",
      "        If False, suppress drawing the figure frame.\n",
      "    \n",
      "    FigureClass : class derived from matplotlib.figure.Figure\n",
      "        Optionally use a custom Figure instance.\n",
      "    \n",
      "    clear : bool, optional, default: False\n",
      "        If True and the figure already exists, then it is cleared.\n",
      "    \n",
      "    Returns\n",
      "    -------\n",
      "    figure : Figure\n",
      "        The Figure instance returned will also be passed to new_figure_manager\n",
      "        in the backends, which allows to hook custom Figure classes into the\n",
      "        pylab interface. Additional kwargs will be passed to the figure init\n",
      "        function.\n",
      "    \n",
      "    Notes\n",
      "    -----\n",
      "    If you are creating many figures, make sure you explicitly call \"close\"\n",
      "    on the figures you are not using, because this will enable pylab\n",
      "    to properly clean up the memory.\n",
      "    \n",
      "    rcParams defines the default values, which can be modified in the\n",
      "    matplotlibrc file\n",
      "\n"
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "help(plt.figure)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on function subplots in module matplotlib.pyplot:\n",
      "\n",
      "subplots(nrows=1, ncols=1, sharex=False, sharey=False, squeeze=True, subplot_kw=None, gridspec_kw=None, **fig_kw)\n",
      "    Create a figure and a set of subplots\n",
      "    \n",
      "    This utility wrapper makes it convenient to create common layouts of\n",
      "    subplots, including the enclosing figure object, in a single call.\n",
      "    \n",
      "    Parameters\n",
      "    ----------\n",
      "    nrows, ncols : int, optional, default: 1\n",
      "        Number of rows/columns of the subplot grid.\n",
      "    \n",
      "    sharex, sharey : bool or {'none', 'all', 'row', 'col'}, default: False\n",
      "        Controls sharing of properties among x (`sharex`) or y (`sharey`)\n",
      "        axes:\n",
      "    \n",
      "            - True or 'all': x- or y-axis will be shared among all\n",
      "              subplots.\n",
      "            - False or 'none': each subplot x- or y-axis will be\n",
      "              independent.\n",
      "            - 'row': each subplot row will share an x- or y-axis.\n",
      "            - 'col': each subplot column will share an x- or y-axis.\n",
      "    \n",
      "        When subplots have a shared x-axis along a column, only the x tick\n",
      "        labels of the bottom subplot are visible.  Similarly, when subplots\n",
      "        have a shared y-axis along a row, only the y tick labels of the first\n",
      "        column subplot are visible.\n",
      "    \n",
      "    squeeze : bool, optional, default: True\n",
      "        - If True, extra dimensions are squeezed out from the returned Axes\n",
      "          object:\n",
      "    \n",
      "            - if only one subplot is constructed (nrows=ncols=1), the\n",
      "              resulting single Axes object is returned as a scalar.\n",
      "            - for Nx1 or 1xN subplots, the returned object is a 1D numpy\n",
      "              object array of Axes objects are returned as numpy 1D arrays.\n",
      "            - for NxM, subplots with N>1 and M>1 are returned as a 2D arrays.\n",
      "    \n",
      "        - If False, no squeezing at all is done: the returned Axes object is\n",
      "          always a 2D array containing Axes instances, even if it ends up\n",
      "          being 1x1.\n",
      "    \n",
      "    subplot_kw : dict, optional\n",
      "        Dict with keywords passed to the\n",
      "        :meth:`~matplotlib.figure.Figure.add_subplot` call used to create each\n",
      "        subplot.\n",
      "    \n",
      "    gridspec_kw : dict, optional\n",
      "        Dict with keywords passed to the\n",
      "        :class:`~matplotlib.gridspec.GridSpec` constructor used to create the\n",
      "        grid the subplots are placed on.\n",
      "    \n",
      "    **fig_kw :\n",
      "        All additional keyword arguments are passed to the :func:`figure` call.\n",
      "    \n",
      "    Returns\n",
      "    -------\n",
      "    fig : :class:`matplotlib.figure.Figure` object\n",
      "    \n",
      "    ax : Axes object or array of Axes objects.\n",
      "    \n",
      "        ax can be either a single :class:`matplotlib.axes.Axes` object or an\n",
      "        array of Axes objects if more than one subplot was created.  The\n",
      "        dimensions of the resulting array can be controlled with the squeeze\n",
      "        keyword, see above.\n",
      "    \n",
      "    Examples\n",
      "    --------\n",
      "    First create some toy data:\n",
      "    \n",
      "    >>> x = np.linspace(0, 2*np.pi, 400)\n",
      "    >>> y = np.sin(x**2)\n",
      "    \n",
      "    Creates just a figure and only one subplot\n",
      "    \n",
      "    >>> fig, ax = plt.subplots()\n",
      "    >>> ax.plot(x, y)\n",
      "    >>> ax.set_title('Simple plot')\n",
      "    \n",
      "    Creates two subplots and unpacks the output array immediately\n",
      "    \n",
      "    >>> f, (ax1, ax2) = plt.subplots(1, 2, sharey=True)\n",
      "    >>> ax1.plot(x, y)\n",
      "    >>> ax1.set_title('Sharing Y axis')\n",
      "    >>> ax2.scatter(x, y)\n",
      "    \n",
      "    Creates four polar axes, and accesses them through the returned array\n",
      "    \n",
      "    >>> fig, axes = plt.subplots(2, 2, subplot_kw=dict(polar=True))\n",
      "    >>> axes[0, 0].plot(x, y)\n",
      "    >>> axes[1, 1].scatter(x, y)\n",
      "    \n",
      "    Share a X axis with each column of subplots\n",
      "    \n",
      "    >>> plt.subplots(2, 2, sharex='col')\n",
      "    \n",
      "    Share a Y axis with each row of subplots\n",
      "    \n",
      "    >>> plt.subplots(2, 2, sharey='row')\n",
      "    \n",
      "    Share both X and Y axes with all subplots\n",
      "    \n",
      "    >>> plt.subplots(2, 2, sharex='all', sharey='all')\n",
      "    \n",
      "    Note that this is the same as\n",
      "    \n",
      "    >>> plt.subplots(2, 2, sharex=True, sharey=True)\n",
      "    \n",
      "    See Also\n",
      "    --------\n",
      "    figure\n",
      "    subplot\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(plt.subplots)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 0.00000000e+00,  2.47978450e-04,  9.91913647e-04,  2.23180422e-03,\n",
       "        3.96764483e-03,  6.19942160e-03,  8.92710571e-03,  1.21506452e-02,\n",
       "        1.58699547e-02,  2.00849040e-02,  2.47953038e-02,  3.00008905e-02,\n",
       "        3.57013087e-02,  4.18960922e-02,  4.85846426e-02,  5.57662070e-02,\n",
       "        6.34398531e-02,  7.16044428e-02,  8.02586043e-02,  8.94007020e-02,\n",
       "        9.90288048e-02,  1.09140653e-01,  1.19733623e-01,  1.30804691e-01,\n",
       "        1.42350395e-01,  1.54366793e-01,  1.66849426e-01,  1.79793269e-01,\n",
       "        1.93192694e-01,  2.07041417e-01,  2.21332460e-01,  2.36058096e-01,\n",
       "        2.51209802e-01,  2.66778213e-01,  2.82753066e-01,  2.99123156e-01,\n",
       "        3.15876276e-01,  3.32999173e-01,  3.50477492e-01,  3.68295725e-01,\n",
       "        3.86437161e-01,  4.04883831e-01,  4.23616464e-01,  4.42614432e-01,\n",
       "        4.61855707e-01,  4.81316812e-01,  5.00972776e-01,  5.20797095e-01,\n",
       "        5.40761692e-01,  5.60836876e-01,  5.80991317e-01,  6.01192010e-01,\n",
       "        6.21404252e-01,  6.41591624e-01,  6.61715972e-01,  6.81737399e-01,\n",
       "        7.01614262e-01,  7.21303172e-01,  7.40759006e-01,  7.59934925e-01,\n",
       "        7.78782395e-01,  7.97251227e-01,  8.15289615e-01,  8.32844189e-01,\n",
       "        8.49860081e-01,  8.66280996e-01,  8.82049293e-01,  8.97106090e-01,\n",
       "        9.11391361e-01,  9.24844067e-01,  9.37402281e-01,  9.49003341e-01,\n",
       "        9.59584008e-01,  9.69080641e-01,  9.77429385e-01,  9.84566375e-01,\n",
       "        9.90427954e-01,  9.94950905e-01,  9.98072699e-01,  9.99731754e-01,\n",
       "        9.99867715e-01,  9.98421740e-01,  9.95336807e-01,  9.90558026e-01,\n",
       "        9.84032977e-01,  9.75712042e-01,  9.65548764e-01,  9.53500207e-01,\n",
       "        9.39527330e-01,  9.23595360e-01,  9.05674186e-01,  8.85738743e-01,\n",
       "        8.63769405e-01,  8.39752383e-01,  8.13680114e-01,  7.85551655e-01,\n",
       "        7.55373062e-01,  7.23157768e-01,  6.88926951e-01,  6.52709881e-01,\n",
       "        6.14544257e-01,  5.74476520e-01,  5.32562146e-01,  4.88865910e-01,\n",
       "        4.43462123e-01,  3.96434832e-01,  3.47877983e-01,  2.97895548e-01,\n",
       "        2.46601600e-01,  1.94120347e-01,  1.40586110e-01,  8.61432440e-02,\n",
       "        3.09460050e-02, -2.48416497e-02, -8.10463253e-02, -1.37485522e-01,\n",
       "       -1.93968040e-01, -2.50294458e-01, -3.06257685e-01, -3.61643599e-01,\n",
       "       -4.16231752e-01, -4.69796171e-01, -5.22106225e-01, -5.72927582e-01,\n",
       "       -6.22023247e-01, -6.69154669e-01, -7.14082939e-01, -7.56570050e-01,\n",
       "       -7.96380235e-01, -8.33281364e-01, -8.67046412e-01, -8.97454974e-01,\n",
       "       -9.24294832e-01, -9.47363562e-01, -9.66470169e-01, -9.81436753e-01,\n",
       "       -9.92100179e-01, -9.98313749e-01, -9.99948867e-01, -9.96896674e-01,\n",
       "       -9.89069645e-01, -9.76403138e-01, -9.58856874e-01, -9.36416325e-01,\n",
       "       -9.09094016e-01, -8.76930702e-01, -8.39996415e-01, -7.98391363e-01,\n",
       "       -7.52246662e-01, -7.01724884e-01, -6.47020411e-01, -5.88359573e-01,\n",
       "       -5.26000558e-01, -4.60233077e-01, -3.91377780e-01, -3.19785402e-01,\n",
       "       -2.45835634e-01, -1.69935713e-01, -9.25187209e-02, -1.40415900e-02,\n",
       "        6.50171804e-02,  1.44160104e-01,  2.22873573e-01,  3.00631004e-01,\n",
       "        3.76896254e-01,  4.51127287e-01,  5.22780089e-01,  5.91312792e-01,\n",
       "        6.56189992e-01,  7.16887235e-01,  7.72895637e-01,  8.23726602e-01,\n",
       "        8.68916601e-01,  9.08031970e-01,  9.40673687e-01,  9.66482072e-01,\n",
       "        9.85141375e-01,  9.96384180e-01,  9.99995597e-01,  9.95817164e-01,\n",
       "        9.83750424e-01,  9.63760107e-01,  9.35876875e-01,  9.00199566e-01,\n",
       "        8.56896899e-01,  8.06208580e-01,  7.48445768e-01,  6.83990865e-01,\n",
       "        6.13296590e-01,  5.36884304e-01,  4.55341572e-01,  3.69318936e-01,\n",
       "        2.79525900e-01,  1.86726114e-01,  9.17317862e-02, -4.60267640e-03,\n",
       "       -1.01387757e-01, -1.97706613e-01, -2.92623504e-01, -3.85192799e-01,\n",
       "       -4.74468494e-01, -5.59514155e-01, -6.39413195e-01, -7.13279379e-01,\n",
       "       -7.80267448e-01, -8.39583741e-01, -8.90496685e-01, -9.32347023e-01,\n",
       "       -9.64557644e-01, -9.86642861e-01, -9.98217020e-01, -9.99002265e-01,\n",
       "       -9.88835352e-01, -9.67673354e-01, -9.35598140e-01, -8.92819507e-01,\n",
       "       -8.39676858e-01, -7.76639327e-01, -7.04304280e-01, -6.23394126e-01,\n",
       "       -5.34751396e-01, -4.39332079e-01, -3.38197209e-01, -2.32502741e-01,\n",
       "       -1.23487763e-01, -1.24611379e-02,  9.92133322e-02,  2.10133064e-01,\n",
       "        3.18874024e-01,  4.24009033e-01,  5.24126839e-01,  6.17851705e-01,\n",
       "        7.03863275e-01,  7.80916412e-01,  8.47860749e-01,  9.03659620e-01,\n",
       "        9.47408081e-01,  9.78349697e-01,  9.95891794e-01,  9.99618862e-01,\n",
       "        9.89303826e-01,  9.64916922e-01,  9.26631914e-01,  8.74829445e-01,\n",
       "        8.10097342e-01,  7.33227730e-01,  6.45210858e-01,  5.47225588e-01,\n",
       "        4.40626567e-01,  3.26928117e-01,  2.07785001e-01,  8.49702066e-02,\n",
       "       -3.96499783e-02, -1.64143324e-01, -2.86541078e-01, -4.04869039e-01,\n",
       "       -5.17179828e-01, -6.21585849e-01, -7.16292388e-01, -7.99630297e-01,\n",
       "       -8.70087649e-01, -9.26339773e-01, -9.67277063e-01, -9.92029962e-01,\n",
       "       -9.99990553e-01, -9.90830234e-01, -9.64512966e-01, -9.21303695e-01,\n",
       "       -8.61771567e-01, -7.86787678e-01, -6.97517173e-01, -5.95405603e-01,\n",
       "       -4.82159591e-01, -3.59721915e-01, -2.30241290e-01, -9.60372133e-02,\n",
       "        4.04396399e-02,  1.76650861e-01,  3.10016888e-01,  4.37965915e-01,\n",
       "        5.57984239e-01,  6.67667081e-01,  7.64768872e-01,  8.47251939e-01,\n",
       "        9.13332541e-01,  9.61523181e-01,  9.90670176e-01,  9.99985501e-01,\n",
       "        9.89072030e-01,  9.57941354e-01,  9.07023544e-01,  8.37168313e-01,\n",
       "        7.49637240e-01,  6.46086877e-01,  5.28542780e-01,  3.99364674e-01,\n",
       "        2.61203221e-01,  1.16949024e-01, -3.03252640e-02, -1.77428673e-01,\n",
       "       -3.21120245e-01, -4.58180574e-01, -5.85485008e-01, -7.00076885e-01,\n",
       "       -7.99239078e-01, -8.80562113e-01, -9.42007125e-01, -9.81961955e-01,\n",
       "       -9.99288799e-01, -9.93361959e-01, -9.64094429e-01, -9.11952252e-01,\n",
       "       -8.37955871e-01, -7.43667980e-01, -6.31167691e-01, -5.03011177e-01,\n",
       "       -3.62179315e-01, -2.12013191e-01, -5.61386766e-02,  1.01618361e-01,\n",
       "        2.57324363e-01,  4.07035777e-01,  5.46899766e-01,  6.73255417e-01,\n",
       "        7.82732786e-01,  8.72347078e-01,  9.39585284e-01,  9.82482704e-01,\n",
       "        9.99686923e-01,  9.90507112e-01,  9.54946783e-01,  8.93718553e-01,\n",
       "        8.08239911e-01,  7.00609462e-01,  5.73563662e-01,  4.30414608e-01,\n",
       "        2.74970017e-01,  1.11437079e-01, -5.56876139e-02, -2.21739334e-01,\n",
       "       -3.82014569e-01, -5.31904940e-01, -6.67031938e-01, -7.83378542e-01,\n",
       "       -8.77413719e-01, -9.46205894e-01, -9.87521624e-01, -9.99906057e-01,\n",
       "       -9.82742141e-01, -9.36286121e-01, -8.61677479e-01, -7.60922192e-01,\n",
       "       -6.36848996e-01, -4.93039151e-01, -3.33731058e-01, -1.63701952e-01,\n",
       "        1.18703317e-02,  1.87561746e-01,  3.57868150e-01,  5.17378207e-01,\n",
       "        6.60947674e-01,  7.83869502e-01,  8.82034049e-01,  9.52073876e-01,\n",
       "        9.91487863e-01,  9.98739920e-01,  9.73328218e-01,  9.15821740e-01,\n",
       "        8.27861927e-01,  7.12128306e-01,  5.72268188e-01,  4.12791751e-01,\n",
       "        2.38935091e-01,  5.64949866e-02, -1.28359702e-01, -3.09294136e-01,\n",
       "       -4.80024377e-01, -6.34537735e-01, -7.67308850e-01, -8.73503721e-01,\n",
       "       -9.49163991e-01, -9.91364310e-01, -9.98336268e-01, -9.69553451e-01,\n",
       "       -9.05773360e-01, -8.09033415e-01, -6.82599863e-01, -5.30870137e-01,\n",
       "       -3.59230946e-01, -1.73876174e-01,  1.84097306e-02,  2.10495650e-01,\n",
       "        3.95166476e-01,  5.65395073e-01,  7.14613338e-01,  8.36971879e-01,\n",
       "        9.27577899e-01,  9.82701427e-01,  9.99940916e-01,  9.78340551e-01])"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "# First create some toy data:\n",
    "x = np.linspace(0,2*np.pi,400)\n",
    "y = np.sin(x**2)\n",
    "\n",
    "# create a figure\n",
    "plt.figure()\n",
    "\n",
    "# create a subplot\n",
    "ax = fig.subplots()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
